<html xmlns:th="http://www.thymeleaf.org">
<div id="addUser" style="margin-top: 12px;margin-right: 23px;">
    <form class="layui-form" action="/user/add" method="post">
        <!--<div class="layui-form-item">-->
        <!--<label class="layui-form-label">注册账户</label>-->
        <!--<div class="layui-input-block">-->
        <!--<input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">-->
        <!--</div>-->
        <!--</div>-->
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-block">
                <input type="text" name="password" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">推广产品</label>
            <div class="layui-input-block">
                <select name="productId" lay-filter="productNameList" onchange="selectChange(this.value)">
                    <option value=""></option>
                    <option th:each="c:${voList}" th:value="${c.id}" th:title="${#dates.format(c.settleTime, 'HH:mm:ss')}" th:text="${c.productName}" onselect="selectChange(this)"></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">结算推送</label>
                <div class="layui-input-block">
                    <input type="text" name="settleAmountPushTime" id="date1" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>


        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" id="formSubmit" lay-submit="" lay-filter="demo1">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>

</div>


<script type="text/javascript">
    layui.use(['form', 'laydate'], function () {
        var form = layui.form
            , laydate = layui.laydate
            , $ = layui.jquery

        form.render();

        //日期时间选择器
        laydate.render({
            elem: '#date1'
            , type: 'time'
        });

        form.on('select(productNameList)', function (data) {
            settle_amount_push_time = data.elem[data.elem.selectedIndex].title;

            $("#date1").val(settle_amount_push_time)

        })
    })


</script>

</html>
